<template>
  <div class="temp" v-if="showModal">
    <Icon type="md-close" class="closeIcon" @click="closeTemp" size="50" color="#fff" />
    <div class="preview-content">
      <!-- <iframe
        :src="iframeUrl"
        style="width: 100%; height: 100%"
        frameborder="0"
        id="myIframe"
        ref="myIframe"></iframe> -->
      <dt-iframe :src="iframeUrl"></dt-iframe>
    </div>
  </div>
</template>
<script>
  export default {
    components: {},
    data() {
      return {
        showModal: false,
        iframeUrl: ''
      }
    },
    computed: {},
    methods: {
      show(params) {
        this.iframeUrl = `${this.$dt.env.h5Url}/market/#/pages/advertisement/detail?advId=${
          params.advertisementId || params.id
        }&origin=${params.origin}&orgId=${params.orgId || null}&roleId=${params.roleId || null}`
        this.showModal = true
      },
      closeTemp() {
        this.showModal = false
      }
    },

    created() {},
    mounted() {},
    watch: {}
  }
</script>
<style lang="scss" scoped>
  .temp {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999999;
    overflow-y: hidden;

    .closeIcon {
      position: absolute;
      top: 10px;
      right: 10px;
      cursor: pointer;
      z-index: 9999;
    }

    .preview-content {
      width: 375px;
      height: 660px;
    }
  }
</style>
